home *** CD-ROM | disk | FTP | other *** search
/ QuickTime for the Web (2nd Edition) / QuickTime for the Web (2nd Edition).iso / pc / Examples / Mixing / FlashStreamLSP / Library / Loader Behavior.txt < prev    next >
Encoding:
INI File  |  2001-09-10  |  2.0 KB  |  90 lines

  1. [Name]
  2. Loader Behavior
  3. by Small Hands, Inc.
  4.  
  5.  
  6. [Description]
  7. Monitor loading progress switch to noted time when ready.
  8.  
  9.  
  10. [Parameters]
  11. Monitor Time, Param_MonitorTime, 00:03.000
  12. Start Loop Time, Param_StartLoop, 00:00.300
  13. End Loop Time, Param_EndLoop, 00:01.500
  14. Switch Time, Param_SwitchTime, 00:02.000
  15.  
  16.  
  17. [Frame Loaded]
  18.  
  19. GlobalVars gInit
  20. GlobalVars gFullyLoaded
  21. GlobalVars gSeenIntro
  22.  
  23. if (gInit ≠ TRUE)    // Check if we've initialized
  24.     gInit = TRUE    // Flag it
  25.         
  26.     gFullyLoaded = FALSE    // Not loaded
  27.     gSeenIntro = 0
  28.     
  29.     SpriteOfID($LoadMonitor).ExecuteEvent($SetUpLoad)  // Setup the loading loop
  30. endif
  31.  
  32.  
  33. [Idle]
  34. GlobalVars gFullyLoaded
  35. GlobalVars gSeenIntro
  36.  
  37. if (gFullyLoaded = FALSE)    // If we're not fully loaded
  38.     gSeenIntro = gSeenIntro + 1
  39.     
  40.     ThisSprite.ExecuteEvent($CheckMovieLoad)    // Check on the status
  41. endif
  42.  
  43.  
  44. [3113 CheckMovieLoad]
  45.  
  46. MovieVars mPublisherWasShown
  47. GlobalVars gFullyLoaded
  48. GlobalVars gSeenIntro
  49.  
  50. if ((MaxLoadedTimeInMovie > $Param_MonitorTime) AND \
  51.     (gSeenIntro > 24))    // Check if we're loaded
  52.     gFullyLoaded = TRUE            // Indicate a complete load
  53.  
  54.     ThisSprite.ExecuteEvent($SwitchTime)    // Switch to new Time range
  55. endif
  56.  
  57.  
  58. [4113 SetUpLoad]
  59.  
  60. StopPlaying
  61.  
  62. SetSelection($Param_StartLoop, $Param_EndLoop)    // Set our loop range
  63. SetPlaySelection(TRUE)                            // Only play loop
  64. SetLoopingFlags(kLoop)                            // Indicate looping
  65. GoToTime($Param_StartLoop)                        // Go to start of loop
  66.  
  67. StartPlaying
  68.  
  69.  
  70. [1776 SwitchTime]
  71.  
  72. StopPlaying                
  73.  
  74. TrackNamed("ripple").SetEnabled(FALSE)    
  75.         
  76. SetSelection(SampleNamed("Menu").StartTime, SampleNamed("Menu").EndTime - 1)    // Select range
  77. SetPlaySelection(TRUE)                            // Unrestrict play
  78. SetLoopingFlags(kNoLoop)                        // Don't loop
  79.  
  80. TrackNamed("LiveStream").SetLayerTo(-5)            // Move the stream forward
  81. TrackNamed("Sprites").SetLayerTo(-10)            // Move the UI to front
  82. TrackNamed("Flasher").SetEnabled(FALSE)
  83. TrackNamed("LiveStream").SetEnabled(TRUE)
  84.  
  85. GoToTime(SampleNamed("Menu").StartTime)            // Go to UI time
  86.  
  87. StopPlaying                                    // Ensure the UI doesn't autoplay the stream
  88.  
  89.  
  90.